#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target)
    {
        unordered_map<int, int> map;
        int n = nums.size();
        for (int i = 0; i < n; i++) {
            if (map.count(target - nums[i])) {
                return { map[ans], i };
            }
            int ans = nums[i];
            map[ans] = i;
        }
        return vector<int>();
    }
};